package com.bst.base.service.impl;

import java.util.Date;
import java.util.List;

import com.bst.common.annotation.Log;
import com.bst.common.utils.self.LoginAPIUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bst.base.mapper.BaseDownloadMapper;
import com.bst.base.domain.BaseDownload;
import com.bst.base.service.IBaseDownloadService;
import com.bst.common.core.text.Convert;

/**
 * 文件下载Service业务层处理
 * 
 * @author laoliu
 * @date 2025-02-26
 */
@Service
public class BaseDownloadServiceImpl implements IBaseDownloadService 
{
    @Autowired
    private BaseDownloadMapper baseDownloadMapper;

    /**
     * 查询文件下载
     * 
     * @param idDownload 文件下载主键
     * @return 文件下载
     */
    @Override
    public BaseDownload selectBaseDownloadByIdDownload(Long idDownload)
    {
        return baseDownloadMapper.selectBaseDownloadByIdDownload(idDownload);
    }

    /**
     * 查询文件下载列表
     * 
     * @param baseDownload 文件下载
     * @return 文件下载
     */
    @Override
    public List<BaseDownload> selectBaseDownloadList(BaseDownload baseDownload)
    {
        return baseDownloadMapper.selectBaseDownloadList(baseDownload);
    }

    /**
     * 新增文件下载
     * 
     * @param baseDownload 文件下载
     * @return 结果
     */
    @Override
    public int insertBaseDownload(BaseDownload baseDownload)
    {
        baseDownload.setDtEmpCre(new Date());
        return baseDownloadMapper.insertBaseDownload(baseDownload);
    }

    /**
     * 修改文件下载
     * 
     * @param baseDownload 文件下载
     * @return 结果
     */
    @Override
    public int updateBaseDownload(BaseDownload baseDownload)
    {
        return baseDownloadMapper.updateBaseDownload(baseDownload);
    }

    /**
     * 批量删除文件下载
     * 
     * @param idDownloads 需要删除的文件下载主键
     * @return 结果
     */
    @Override
    public int deleteBaseDownloadByIdDownloads(String idDownloads)
    {
        return baseDownloadMapper.deleteBaseDownloadByIdDownloads(Convert.toStrArray(idDownloads));
    }

    /**
     * 删除文件下载信息
     * 
     * @param idDownload 文件下载主键
     * @return 结果
     */
    @Override
    public int deleteBaseDownloadByIdDownload(Long idDownload)
    {
        return baseDownloadMapper.deleteBaseDownloadByIdDownload(idDownload);
    }
}
